#include "cache.h"

int main(void)
{
    int entries = read_cache();
    for (int i = 0; i < entries; i++) {
        struct cache_entry p = *(active_cache[i]);
        if (i % 20 == 0) {
            puts("ce_ctime.sec ce_ctime.nsec ce_mtime.sec ce_mtime.nsec ce_dev ce_ino ce_mode ce_uid ce_gid ce_size sha1 ce_flags name");
        }
        printf("%08x %08x ", p.ce_ctime.sec, p.ce_ctime.nsec);
        printf("%08x %08x ", p.ce_mtime.sec, p.ce_mtime.nsec);
        printf("%08x %08x ", p.ce_dev, p.ce_ino);
        printf("%08x ", p.ce_mode);
        printf("%08x %08x ", p.ce_uid, p.ce_gid);
        printf("%08x ", p.ce_size);
        for (int k = 0; k < 20; k++) {
            printf("%02x", p.sha1[k]);
        }
        
        printf(" %04x ", p.ce_flags);
        printf("%0s\n", active_cache[i]->name);
    }
    return 0;
}
